package com.ynkbny.service.impl;

import com.ynkbny.base.PageResult;
import com.ynkbny.domain.mongo.SbLog;
import com.ynkbny.domain.mongo.SbLogQueryVO;
import com.ynkbny.service.SbLogService;
import com.ynkbny.util.MongoUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 企业基本信息表-表服务实现类
 *
 * @author : juzipi123
 * @date : 2023-7-5
 */
@Slf4j
@Service
public class SbLogServiceImpl implements SbLogService {

    @Resource
    private MongoUtil mongoUtil;

    /**
     * 分页查询
     *
     * @param sbLogQueryVO 筛选条件
     * @return 查询结果
     */
    @Override
    public PageResult<SbLog> paginQuery(SbLogQueryVO sbLogQueryVO) {
        long count = mongoUtil.count(sbLogQueryVO, SbLog.class, "sbLog");
        List<SbLog> logssList = mongoUtil.paginQuery(sbLogQueryVO, SbLog.class, "sbLog");
        return new PageResult<>(logssList, count, sbLogQueryVO.getPageNum(), sbLogQueryVO.getPageSize());
    }

}